package com.etone.system.service.impl;

import java.util.List;
import java.util.Map;

import com.etone.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.etone.system.mapper.SysStorageMapper;
import com.etone.system.domain.SysStorage;
import com.etone.system.service.ISysStorageService;

/**
 * 货位Service业务层处理
 * 
 * @author etone
 * @date 2025-05-27
 */
@Service
public class SysStorageServiceImpl implements ISysStorageService 
{
    @Autowired
    private SysStorageMapper sysStorageMapper;

    /**
     * 查询货位
     * 
     * @param id 货位主键
     * @return 货位
     */
    @Override
    public Map<String,Object> selectSysStorageById(Long id)
    {
        return sysStorageMapper.selectSysStorageById(id);
    }

    /**
     * 查询货位列表
     * 
     * @param sysStorage 货位
     * @return 货位
     */
    @Override
    public List<Map<String,Object>> selectSysStorageList(SysStorage sysStorage)
    {
        return sysStorageMapper.selectSysStorageList(sysStorage);
    }

    /**
     * 新增货位
     * 
     * @param sysStorage 货位
     * @return 结果
     */
    @Override
    public int insertSysStorage(SysStorage sysStorage)
    {
        sysStorage.setCreateTime(DateUtils.getNowDate());
        return sysStorageMapper.insertSysStorage(sysStorage);
    }

    /**
     * 修改货位
     * 
     * @param sysStorage 货位
     * @return 结果
     */
    @Override
    public int updateSysStorage(SysStorage sysStorage)
    {
        sysStorage.setUpdateTime(DateUtils.getNowDate());
        return sysStorageMapper.updateSysStorage(sysStorage);
    }

    /**
     * 批量删除货位
     * 
     * @param ids 需要删除的货位主键
     * @return 结果
     */
    @Override
    public int deleteSysStorageByIds(Long[] ids)
    {
        return sysStorageMapper.deleteSysStorageByIds(ids);
    }

    /**
     * 删除货位信息
     * 
     * @param id 货位主键
     * @return 结果
     */
    @Override
    public int deleteSysStorageById(Long id)
    {
        return sysStorageMapper.deleteSysStorageById(id);
    }
}
